function clicked(obj)
{
	if(obj.value=='Search...')
		obj.value = '';
	obj.className = 'focused';
}

function blured(obj)
{
	if(obj.value=='')
		obj.value = 'Search...';
	obj.className = 'notfocused';
}

function do_search(url)
{
    var what = document.getElementById('what');
    var form = document.getElementById('searchform');
    if(what.value==null || what.value == undefined || what.value =='Search...')
        return false;
    form.submit();
    //window.location= url+'search/?what='+what.value;
}

function hidesearchbtn()
{
	document.getElementById('submit').style.display='none';
}

// function to get a cookie
function getCookie(c_name)
{
    if (document.cookie.length>0)
    {
        c_start=document.cookie.indexOf(c_name + "=")
        if (c_start!=-1)
        { 
            c_start=c_start + c_name.length+1 
            c_end=document.cookie.indexOf(";",c_start)
            if (c_end==-1) c_end=document.cookie.length
                return unescape(document.cookie.substring(c_start,c_end))
        }
    }
    return ""
}    

// function to set a cookie
function setCookie(c_name,value,expiredays)
{
    var exdate = new Date()
    exdate.setDate(exdate.getDate() + expiredays)
    document.cookie=c_name+ "=" +escape(value)+
    ((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) // If then else statement ?:
}

function getXmlHttp()
{
    var xmlHttp=null;
    try
    {
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
    }
    catch (e)
    {
        // Internet Explorer
        try
        {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp;
}